package com.haiwen.boot.vo;

import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;

import java.util.HashMap;


@Component
@Scope("prototype")
public class ResultMap extends HashMap<String, Object> {
    public ResultMap() {
    }

    public ResultMap success() {
        this.put("result", "success");
        return this;
    }

    public ResultMap fail() {
        this.put("result", "fail");
        return this;
    }

    public ResultMap code(int code) {
        this.put("code", code);
        return this;
    }

    public ResultMap message(Object message) {
        this.put("message", message);
        return this;
    }
    public ResultMap content(Object content) {
        this.put("content", content);
        return this;
    }
    public ResultMap token(Object token) {
        this.put("token", token);
        return this;
    }
}

